<?php
require_once('BaseModel.php');
require_once('User.php');
require_once('Personnage.php');

require_once 'BaseModel.php';

/**
 * @access public
 * @author Joana
 * @package Mapping_Dead.Modèle
 */
class Vote extends BaseModel {

    /**
     * @AttributeType int
     */
    protected $idVote;

    /**
     * @AttributeType 
     */
    protected $typeVote;

    /**
     * @AttributeType int
     */
    protected $idRepere;

    /**
     * @AttributeType int
     */
    protected $idFichePersonnage;

    /**
     * @AttributeType int
     */
    protected $idUser;

    /**
     * @AttributeType string
     */
    protected $dateVote;

    /**
     * @AttributeType int
     */
    protected $votePour;

    /**
     * @AttributeType int
     */
    protected $voteContre;

    public function __construct($id = null) {
        parent::__construct($id);
    }

    public function afficherListeVote() {
        return parent::findAll();
    }

    public function pour($idVote,$nbPour) {
        $args = array('votePour'=>$nbPour);
        return $this->updateElement($args, $idVote);
    }

    public function contre($idVote,$nbContre) {
        $args = array('voteContre'=>$nbContre);
        return $this->updateElement($args, $idVote);
    }

    public function confirmeVote($idVote,$idUser,$resultatVote) {
        $args = array('idUser'=>$idUser,'idVote'=>$idVote,'resultatVote'=>$resultatVote);
        return $this->addElementListeVote($args);
    }

    public function existeVote($idUser, $idVote) {
        $args = array('idUser'=>$idUser,'idVote'=>$idVote);
        return $this->getElementListeVote($args);
    }

    /**
     * @access public
     * @return int
     * @ReturnType int
     */
    public function getIdVote() {
        return $this->idVote;
    }

    /**
     * @access public
     * @param int idVote
     * @return void
     * @ParamType idVote int
     * @ReturnType void
     */
    public function setIdVote($idVote) {
        $this->idVote = $idVote;
    }

    public function getIdFichePersonnage() {
        return $this->idFichePersonnage;
    }

    /**
     * @access public
     * @return int
     * @ReturnType int
     */
    public function getIdElement() {
        return $this->idElement;
    }

    /**
     * @access public
     * @param int idElement
     * @return void
     * @ParamType idElement int
     * @ReturnType void
     */
    public function setIdElement($idElement) {
        $this->idElement = $idElement;
    }

    /**
     * @access public
     * @return int
     * @ReturnType int
     */
    public function getIdUser() {
        return $this->idUser;
    }

    /**
     * @access public
     * @param int idUser
     * @return void
     * @ParamType idUser int
     * @ReturnType void
     */
    public function setIdUser($idUser) {
        $this->idUser = $idUser;
    }

    /**
     * @access public
     * @return string
     * @ReturnType string
     */
    public function getDate() {
        return $this->date;
    }

    /**
     * @access public
     * @param string date
     * @return void
     * @ParamType date string
     * @ReturnType void
     */
    public function setDate($date) {
        $this->date = $date;
    }

    /**
     * @access public
     * @return int
     * @ReturnType int
     */
    public function getVotePour() {
        return $this->votePour;
    }

    /**
     * @access public
     * @param int votePour
     * @return void
     * @ParamType votePour int
     * @ReturnType void
     */
    public function setVotePour($votePour) {
        $this->votePour = $votePour;
    }

    /**
     * @access public
     * @return int
     * @ReturnType int
     */
    public function getVoteContre() {
        return $this->voteContre;
    }

    /**
     * @access public
     * @param int voteContre
     * @return void
     * @ParamType voteContre int
     * @ReturnType void
     */
    public function setVoteContre($voteContre) {
        $this->voteContre = $voteContre;
    }

    /**
     * @access public
     * @param int idPersonnage
     * @param int idEpisode
     * @param String description
     * @ParamType idPersonnage int
     * @ParamType idEpisode int
     * @ParamType description String
     */
    public function proposerFichePersonnage($idPersonnage, $idEpisode, $description) {
        // Not yet implemented
    }

    /**
     * @access public
     * @param int vote
     * @param int idVote
     * @ParamType vote int
     * @ParamType idVote int
     */
    public function voteFichePersonnage($vote, $idVote) {
        // Not yet implemented
    }

    /**
     * @access public
     * @param int idVote
     * @ParamType idVote int
     */
    public function confirmerVote($idVote) {
        // Not yet implemented
    }
    
}

?>